<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    // `instanceof`是如何判断的?
    // * 表达式: A` instanceof` B
    // * 如果B函数的显式原型对象在A对象的原型链上, 返回true, 否则返回false
    {
        const arr = [];
        console.log(arr.__proto__ === Array.prototype);// true
        console.log(Array.prototype.__proto__ === Object.prototype);// true
        console.log(Object.prototype.__proto__);// null;
        console.log(arr.__proto__.__proto__.__proto__);// null
        console.log(arr instanceof Array);// true
        console.log(arr instanceof Object);// true

        function fn(){

        }

        console.log(fn instanceof Function);
        console.log(fn instanceof Object);

        function Box(){

        }
        const obj = new Box();
        console.log(obj instanceof Box);
        console.log(obj instanceof Object)
    }
</script>
</html>